{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Implementation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np \n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "from sklearn import datasets\n",
    "wine = datasets.load_wine()\n",
    "X, y = wine.data, wine.target"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The code below shows `scikit-learn` implementations of LDA, QDA, and Naive Bayes using the {doc}`wine </content/appendix/data>` dataset. Note that the Naive Bayes implementation assumes *all* variables follow a Normal distribution, unlike the construction in the previous section."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.discriminant_analysis import LinearDiscriminantAnalysis, QuadraticDiscriminantAnalysis\n",
    "from sklearn.naive_bayes import GaussianNB\n",
    "\n",
    "lda = LinearDiscriminantAnalysis()\n",
    "lda.fit(X, y);\n",
    "\n",
    "qda = QuadraticDiscriminantAnalysis()\n",
    "qda.fit(X, y);\n",
    "\n",
    "nb = GaussianNB()\n",
    "nb.fit(X, y);"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Next, let's check that these `scikit-learn` implementations return the same decision boundaries as our constructions in the previous section. The code to create these graphs is written below. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def graph_boundaries(X, model, model_title, n0 = 1000, n1 = 1000, figsize = (7, 5), label_every = 4):\n",
    "        \n",
    "        # Generate X for plotting \n",
    "        d0_range = np.linspace(X[:,0].min(), X[:,0].max(), n0)\n",
    "        d1_range = np.linspace(X[:,1].min(), X[:,1].max(), n1)\n",
    "        X_plot = np.array(np.meshgrid(d0_range, d1_range)).T.reshape(-1, 2)\n",
    "        \n",
    "        # Get class predictions\n",
    "        y_plot = model.predict(X_plot).astype(int)\n",
    "        \n",
    "        # Plot \n",
    "        fig, ax = plt.subplots(figsize = figsize)\n",
    "        sns.heatmap(y_plot.reshape(n0, n1).T,\n",
    "                   cmap = sns.color_palette('Pastel1', 3),\n",
    "                   cbar_kws = {'ticks':sorted(np.unique(y_plot))})\n",
    "        xticks, yticks = ax.get_xticks(), ax.get_yticks()\n",
    "        ax.set(xticks = xticks[::label_every], xticklabels = d0_range.round(2)[::label_every],\n",
    "               yticks = yticks[::label_every], yticklabels = d1_range.round(2)[::label_every])\n",
    "        ax.set(xlabel = 'X1', ylabel = 'X2', title = model_title + ' Predictions by X1 and X2')\n",
    "        ax.set_xticklabels(ax.get_xticklabels(), rotation=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAFNCAYAAACkMKB8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3de5RkZX3u8e8jg3pQURDhDJcRL4gSgwiDGK+IIRkgLsArLDV4ApJ7NCsaOUlOzIpiUGPiyTpRMyBCEsAYQUTCNRMVFVQQRLmoEI9Ch5EJIkcQiY7+zh97txRNd0/PdF12VX0/a9Wq2u++1G/3QD39vvut3akqJEnqkoeMugBJkuYynCRJnWM4SZI6x3CSJHWO4SRJ6hzDSZLUOYaTxlqS3ZNUkhXt8oVJjtmC46xKck+Srfpf5YLveVqStw/r/UYlybeS/OKo69B4MZym0EIfFkkOTPLT9kP6niQzST6SZP95tk2Sbya5YYnv98P2mLcn+VCSR/brfHpV1SFVdfoSa/rZz6CqbqmqR1bVTwZR1yAl2TXJ95I8r6dtt7btgHb5lUkuT3Jvkk+NrNg5kpydZO2ctnOT/J/29WFJPpvkriTfSXJykkeNploNk+GkuW6rqkcCjwKeDXwN+EySF8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/++RBJy2Q4SVuovWnw+4E3VtUtNJMg/nK0VUmTwXCSttzrgVuq6tJ2+X3AU5O8sL3j9D8DL04yk+SXR1alNIa8K7kkqXPsOUmSOsdwkiR1juEkSeocw0mS1DmGkySpcwwnSVLnGE6SpM4xnCRJnfP/ATTVohVlhUInAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 504x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "X_2d = X.copy()[:,2:4]\n",
    "lda_2d = LinearDiscriminantAnalysis()\n",
    "lda_2d.fit(X_2d, y);\n",
    "graph_boundaries(X_2d, lda_2d, 'LDA')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAFNCAYAAACkMKB8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3de7ScZX328e9ldkQRkXDKGw4pKOcKphBEQUGgqQFkQQCBCBoUiFqt2lWp1Hb5opYawaqvVaQBA1ExaOUUEULSCAQlKuEQCUQMRQhbIgEDQqQogd/7x3NvmQwzs0/zzNwzc33WmrVnntP8Zu9krv27n3uerYjAzMwsJy9rdwFmZmbVHE5mZpYdh5OZmWXH4WRmZtlxOJmZWXYcTmZmlh2Hk3U8SadJ+nHF4/WSXjuC45wiaWFzqxv0OR+U9NetfM5Wk7STpJDU1+5arHM4nHpMeiO/W9Izkn4r6QJJr6lYf46k5yQ9nW6/kvRVSRNqHGtnSS9IumCQ5xx4c1qfbg9KOruM1wcQEZtFxANDrKmvYr/LIuJvyqqrTJKOTj/PLSuWHSPpNwM/X0mfTT/7DZLOaVuxFSRtlv49vKti2aslrZZ0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zazGAdNp/5Be9jVCwzpXA4dI6pM0FjgEaMuwXr0aJY2RtFVavg/FZImF7aixUkTsHBE7RcROwPeBv83xjTXXOnOtqxN0dOckaR7wNmBrSf3A/6U42U1EXAgcD7xH0nPA/wInpZPRz0v6OLA4vVHcDlyUWY2omN6+I3BzGbV1Uo2jqVPS9yl+AbmbYgLCgoj4QWY1jgVuSbn1FHBqRJQ+rDeEerOQa52jqUvSLcAewGZp39Mjou1D47nwFSLMzCw7XT2sZ2ZmncnhZGZm2XE4mZlZdhxOZmaWHYeTmZllx+FkNkKSdpT0a0lbpsfj0uO/8BWnzUbH4WQ2QhHxMPB1YFZaNAuYHREPAecD725XbWadzuFkNjpfAt4k6WPAW4B/B19x2my0OvoKEWbtFhHPSToLWAD8TUT8qd01mXUDd05mo3cExZ/ieH27CzHrFg4ns1GQNAmYQnGV879Pfz7EzEbJ4WQ2QumiwV8HPhYRqykmQXyhvVWZdQeHk9nInQmsjohF6fEFwB6SDklXnP4v4HBJ/ZLe3rYqzTqQr0puZmbZcedkZmbZcTiZmVl2HE5mZpYdh5OZmWXH4WRmZtlxOJmZWXYcTmZmlh2Hk5mZZef/AwjQ4dvhmv+nAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 504x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "qda_2d = QuadraticDiscriminantAnalysis()\n",
    "qda_2d.fit(X_2d, y);\n",
    "graph_boundaries(X_2d, qda_2d, 'QDA')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAacAAAFNCAYAAACkMKB8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+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ZWXdyOJmZWXYcTmZmlh2Hk5mZZcfhZGZm2XE4mW0kSRMk/UrSuPR8bHq+k684bTY6DiezjRQRDwBfBWanQbOBORFxP3AO8I5O1WbW7RxOZqPzOWB/SacBrwP+HXzFabPR6uorRJh1WkT8RdIZwHzgbyLiz52uyawXuOVkNnqHUfwrjpd3uhCzXuFwMhsFSXsB0yiucv6B9O9DzGyUHE5mGyldNPirwGkRsZLiJIh/62xVZr3B4WS28d4NrIyIhen5V4DdJR2Urjj9/4BDJQ1KemPHqjTrQr4quZmZZcctJzMzy47DyczMsuNwMjOz7DiczMwsOw4nMzPLjsPJzMyy43AyM7PsOJzMzCw7/wOsvEbpRpFMuAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 504x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "nb_2d = GaussianNB()\n",
    "nb_2d.fit(X_2d, y);\n",
    "graph_boundaries(X_2d, nb_2d, 'Naive Bayes')"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Edit Metadata",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
